package cn.ciis.basic.base;

import cn.ciis.basic.model.Permission;
import cn.ciis.basic.model.Role;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import com.jfinal.kit.Ret;

import java.util.List;

public class BaseCache {
    /**
     * 全部权限缓存key
     */
    public static final String ALL_PERMISSION="all_permission";

    /**
     * 全部权限缓存工具。默认缓存10分钟。
     */
    public static TimedCache<String, List<Permission>> PERMISSIONLIST_TIMEDCACHE = CacheUtil.newTimedCache(600_000);

    /**
     * 全部权限缓存key
     */
    public static final String ALL_ROLE="all_roles";

    /**
     * 角色集合缓存工具。默认缓存1小时。
     */
    public static TimedCache<String, List<Role>> ROLE_TIMEDCACHE = CacheUtil.newTimedCache(3600_000);

    /**
     * 权限验证缓存.默认保存半小时
     */
    public static final String AUTH_TIMEDCACHE = "auth_timedcache";//CacheUtil.newTimedCache(1800_000);

    /**
     * 所有超级管理员
     */
    public static final String ALL_SUPER_ADMIN ="all_super_admin";

    public static final TimedCache<String, Ret> IPBLACK = CacheUtil.newTimedCache(1800_000L);//IP错误包次数

    /**
     * 系统是否在维护中
     */
    public static boolean ISMAINTAIN = false;//系统是否维护中

    //企业
    public static final String ENTERPRISE_TIMED_CACHE="enterprise_timed_cache";
    //设备
    public static final String EQUIPMENT_TIMED_CACHE="equipment_timed_cache";

    public static final String EQUIPMENT_DATA_DICTIONARY = "equipment_data_dictionary";
    public static final String WS_SESSION_ID_DICTIONARY = "ws_session_id_dictionary";

}
